import request from '@/utils/request'
import {getCertificatesByEmpId} from "@/api/hrm/certificate";

// 查询员工假期管理列表
export function listBalance(query) {
  return request({
    url: '/leave/balance/list',
    method: 'get',
    params: query
  })
}

// 查询员工假期管理详细
export function getBalance(id) {
  return request({
    url: '/leave/balance/' + id,
    method: 'get'
  })
}

// 新增员工假期管理
export function addBalance(data) {
  return request({
    url: '/leave/balance',
    method: 'post',
    data: data
  })
}

// 修改员工假期管理
export function updateBalance(data) {
  return request({
    url: '/leave/balance',
    method: 'put',
    data: data
  })
}

// 删除员工假期管理
export function delBalance(id) {
  return request({
    url: '/leave/balance/' + id,
    method: 'delete'
  })
}

// 根据员工ID查询假期余额
export function getBalanceByEmpId(empId) {
  return request({
    url: '/leave/balance/listByEmpId/' + empId,
    method: 'get'
  });
}
